package com.ideaaedi.zoo.example.springboot.auth.satoken.enums;

import com.ideaaedi.zoo.commonbase.entity.codemsg.CodeMsgProvider;
import lombok.Getter;

/**
 * (non-javadoc)
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img
 * src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 1.0.0
 */
@Getter
public enum DemoCodeMsgEnum implements CodeMsgProvider {
    SUCCESS(SUC_CODE, "成功"),
    ACCESS_DENY("11051", "没有权限呀！骚年~"),
    MISS_JWT_TOKEN("11017", "缺少jwt token凭证"),
    EXPIRED_TOKEN("11018", "token已过期"),
    ARGS_ILLEGAL("zf-bs-100002", "参数有误"),
    HTTP_MSG_READ_ERROR("zf-bs-100003", "读取数据失败，请检查数据格式"),
    HTTP_REQUEST_METHOD_NOT_SUPPORTED_FAIL("zf-bs-100004", "请使用支持的http方法"),
    MISSING_SERVLET_REQUEST_PARAMETER_FAIL("zf-bs-100005", "缺少必要参数，请补充后重试"),
    AUTH_OCCUR_EXCEPTION("zf-bs-100511", "认证鉴权异常"),
    FILTER_AUTH_OCCUR_EXCEPTION("zf-bs-100512", "拦截器认证鉴权异常"),
    ;
    
    private final String code;
    
    private final String message;
    
    DemoCodeMsgEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }
    
    @Override
    public String code() {
        return this.code;
    }
    
    @Override
    public String message() {
        return this.message;
    }
    
    @Override
    public String toString() {
        return "{\"code\":\"" + code + "\", \"message\":\"" + message + "\"}";
    }
}
